package at.fhv.wordProcessing.data;

import java.util.ArrayList;
import java.util.List;

/**
 * The Page class.
 * 
 * @author Michael Sieber
 */
public class Page {
	private List<Line> _lines;
	private int _pageSize;

	/**
	 * Create a new page.
	 * 
	 * @param pageSize The maximum page size
	 */
	public Page(int pageSize) {
		_pageSize = pageSize;
		_lines = new ArrayList<Line>();
	}

	/**
	 * Add a line item
	 * 
	 * @param line The line to add
	 * @return True if the page size is not exceeded
	 */
	public boolean addLine(Line line) {
		if (_lines.size() < _pageSize) {
			_lines.add(line);
			return true;
		}

		return false;
	}
}
